package com.mai4j.maiadmin.model.http;

import com.mai4j.maiadmin.validation.constraints.LanguageTag;
import com.mai4j.maiadmin.validation.constraints.Option;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.util.List;
import java.util.Map;

/**
 * 微信公众号请关注: 开源螺丝钉
 * <br>
 * 码云请关注: <a href="https://gitee.com/xiyoufang">https://gitee.com/xiyoufang</a>
 * <br>
 * 哔哩哔哩请关注: <a href="https://space.bilibili.com/438927834">https://space.bilibili.com/438927834</a>
 *
 * @author xiyoufang
 */
@Setter
@Getter
@Accessors(chain = true)
public class AdminMenuSaveOrUpdateReq {

    @Setter
    @Getter
    @Accessors(chain = true)
    public static class AdminMenuDescription {
        @NotNull
        @Length(min = 1, max = 16)
        private String name;
    }

    @Positive
    private String adminMenuId;

    @NotEmpty
    private Map<@LanguageTag String, @Valid AdminMenuDescription> descriptions;

    @NotEmpty
    @Option(options = {"0", "1"})
    private String status;

    @NotEmpty
    private List<AdminMenuItemReq> content;
}
